package cn.ghx.xboot.mapper;

import cn.ghx.xboot.attach.Attachment;
import cn.ghx.xboot.item.Item;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author ghx
 * @createDate 2024-03-08 10:46:26
 */
public interface ItemMapper extends BaseMapper<Item> {

    boolean saveMedias(@Param("id") String id, @Param("attIds") List<String> attIds);

    boolean removeMedias(@Param("id") String id);

    List<Attachment> getMedias(@Param("id") String id);

    Page<Item> query(
            @Param("keyword") String keyword,
            @Param("brandId") String brandId,
                     @Param("storeId") String storeId,
                     @Param("tonnageStart") Float tonnageStart,
                     @Param("tonnageEnd") Float tonnageEnd,
                     @Param("priceStart") Float priceStart,
                     @Param("priceEnd") Float priceEnd,
                     @Param("hourStart") Integer hourStart,
                     @Param("hourEnd") Integer hourEnd,
                     @Param("rentable") Boolean rentable,
                     @Param("province")  String province,
                     @Param("sort") String sort,
                     Page<Item> page);


    List<Item> getRecommend( @Param("originId") String originId, @Param("size") Integer size);
}




